#cmake_minimum_required(VERSION 3.0.2)

project(statsxx)

set(CMAKE_BUILD_TYPE Release)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")

#---------------------------------------------------------
# COMPILATION
#---------------------------------------------------------

include_directories(include)

# add_sources
macro (add_sources)
    file (RELATIVE_PATH _relPath "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
    foreach (_src ${ARGN})
        if (_relPath)
            list (APPEND SRCS "${_relPath}/${_src}")
        else(_relPath)
            list (APPEND SRCS "${_src}")
        endif(_relPath)
    endforeach(_src ${ARGN})
    if (_relPath)
        # propagate SRCS to parent directory
        set (SRCS ${SRCS} PARENT_SCOPE)
    endif(_relPath)
endmacro (add_sources)

#add_subdirectory(src/interpolation)
add_subdirectory(src/resampling)
add_subdirectory(src/regression)

add_library(statsxx ${SRCS})

#---------------------------------------------------------
# INSTALL
#---------------------------------------------------------
#
#if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
#    set (CMAKE_INSTALL_PREFIX ".." CACHE PATH "default install path" FORCE )
#endif()
#
# default install to ../lib/
#install(TARGETS statsxx DESTINATION lib)
